<template>
    <div class='ltTv'>
        <template  v-if="info">
            <div class='ltName'>{{ltName}}</div>
            <div class='remark'>{{info}}</div>
        </template>
        <div class='ltName2' v-else>
            {{ltName}}
        </div>
    </div>
</template>
<script>
export default {
    data(){
        return{
            ltName:"",
            appid:"",
            info:""
        }
    },
    created(){
        document.documentElement.style.fontSize = document.documentElement.clientWidth*20/320 + 'px';  
        if(this.$route.query.appid){
            this.appid=this.$route.query.appid;
        }
        if(this.$route.query.ltName){
            this.ltName=this.$route.query.ltName;
        }
        this.loadData();
        let sef=this;
        setInterval(function () {
            sef.loadData();
        }, 5000);
    },
    methods:{
        loadData(){
            this.$post(this.appid,"/hardware/getLtTv",{oldVer:localStorage.getItem("ltver"),ltName:this.ltName}).then(data=>{
                let sVer=data[0].sVer;
               
                if(localStorage.getItem("ltver")!=sVer){
                   
                    localStorage.setItem("ltver",sVer);
                    location.reload();
                }
                let info=data[0].info;
                //info="张三(男）54岁"
                this.info=info;

            })
        }
    }
}
</script>
<style scoped>
 .ltTv{
     width:100%;
     height:100%;
     background-image:url('../../../assets/img/1.jpg') ;
     background-repeat: no-repeat;
     background-size: 100% 100%;
     display:flex;
     flex-direction: column;
     justify-content: center;
     align-items: center;
 }
 .ltName2{
     font-size:2.6rem;
 }
 .ltName{
     font-size:2rem;
 }
 .remark{
     font-size:1rem;
 }
</style>